<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>大卫杜夫 | 雪茄</title>
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<link rel="shortcut icon" type="image/ico" href="http://davidoff.com/favicon.ico" />
	<link href="static/lib/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
	<link href="static/css/main.css" rel="stylesheet">
</head>
<body>
	<div id="header"><!--#include file="/component/header.html"--></div>
	<div class="top-banner">
		<section class="kv">
			<a href="javascript:void(0)">
				<div id="kv_wp">
					<script id="kv_tpl" type="text/html">
						<a href="javascript:void(0)"><div style="background-color:#090e14;background-image:url('<%:=kvList.IMG_URL%>')">&nbsp;</div></a>
                            </script>
				</div>
			</a>
		</section>
	</div>
	<div class="page_wrapper indexbox">
		<div class="main_cont">
			<div id="wp">
				<script id="tpl" type="text/html">
					<section class="row news">
                    <%for(var i = 0; i < list.length; i++) {%>
				<div class="col-sm-12 col-md-4 col-lg-4 col-xl-4">
					<a class="news_list" href="<%:=list[i].LINK%>">
						<img src="<%:=list[i].IMG_URL%>" alt="<%:=list[i].TITLE%>">
						<div class="indexMask">
							<div class="txt"><%:=list[i].TITLE%></div>
						</div>
					</a>
				</div>
                <%}%>
            </script>
			</div>
			</section>
			<section>
				<div id="news_wp">
					<script id="news_tpl" type="text/html">
						<%for(var j = 0; j < newslist.length; j++) {%>
				<h1><%:=newslist[j].TITLE%></h1>
				<div class="kv"><a href="<%:=newslist[j].LINK%>"><img src="<%:=newslist[j].IMG_URL%>" alt="<%:=newslist[j].TITLE%>"></a></div>
				<%}%></script>
				</div>
			</section>
			<section>
				<h1>购买我们的产品</h1>
				<div class="kv kvprd">
					<img src="static/images/kv3.jpg">
					<div class="txtbox">
						<b>购买</b>
						<p>自1911年以来，日内瓦大卫杜夫旗舰店是那些渴望精致手工制作的雪茄、奢侈配饰和精致礼品的人们首选目的地。</p>

						<a href="map/index.html" class="btn_yellow">临近店铺</a>
					</div>

				</div>
			</section>
		</div>
	</div>
	<!--footer start  -->
	<div id="footer"></div>
	<!--footer end  -->
	<script type="text/javascript" src="static/lib/fancyBox-2.1.5/lib/jquery-1.10.1.min.js"></script>
	<script src="static/lib/bootstrap/dist/js/bootstrap.min.js"></script>
	<script src="static/js/common.js"></script>
	<script src="static/js/template.js"></script>
	<script>
		var ProductTypeList = []
		var NewsList = []
		function getNews() {
			var tpl = document.getElementById('news_tpl').innerHTML;
			var html = template(tpl, {
				newslist: NewsList
			});
			$("#news_wp").append(html);
		}
		function getKv() {
			$.post("http://davidoff.gemdesign.cn/CMS/api/CMS", {
				"cmd": "kv.list.get",
				"param": {
					"KEY_WORD": "",
					"PAGE_INDEX": 1,
					"PAGE_SIZE": 20
				}
			}, function (data) {
				var kv = data.KV_LIST[0];
				var tpl = document.getElementById('kv_tpl').innerHTML;
				var html = template(tpl, {
					kvList: kv
				});
				//console.log(kv)
				$("#kv_wp").append(html);
			});
		}
	/* 	$(function () { */
			getKv();
			$.post("http://davidoff.gemdesign.cn/CMS/api/CMS", {
				"cmd": "mainpage.list.get",
				"param": {}
			}, function (data) {
				NewsList = ProductTypeList = data.LIST.filter(function (elem) {
					return elem.ITEM_TYPE == '新闻'
				});
				ProductTypeList = data.LIST.filter(function (elem) {
					return elem.ITEM_TYPE == '产品'
				});
				//console.log(ProductTypeList)
				var tpl = document.getElementById('tpl').innerHTML;
				var html = template(tpl, {
					list: ProductTypeList
				});
				$("#wp").append(html);
				getNews();
			});
		/* }) */

	</script>
</body>

</html>
